﻿@using System.Reflection
@using Masa.Contrib.StackSdks.Caller;
@using Masa.Stack.Components.Shared
@using MasaWasmApp.Shared
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@* @inject TokenProvider TokenProvider *@

<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(App).Assembly" AdditionalAssemblies="additionalAssemblies">
        <Found Context="routeData">
            <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
            <FocusOnNavigate RouteData="@routeData" Selector="h1" />
        </Found>
        <NotFound>
            <MApp>
                <NotFound />
            </MApp>
        </NotFound>
    </Router>
</CascadingAuthenticationState>

@code {

    private List<Assembly> additionalAssemblies = new();

    public App()
    {
        var masaStackComponentsAssembly = typeof(Masa.Stack.Components.UserCenter).Assembly;
        additionalAssemblies.Add(masaStackComponentsAssembly);
    }
}
